package com.itheima.recursion;

public class RecursionDemo1 {
    public static void main(String[] args) {
        //求10的阶乘
        int num = 10;
        System.out.println(factorial(num));
    }
    /*
    *
    * */
    private static int factorial(int num) {
        if (num == 1){
            return 1;
        }else{
            return num*factorial(num-1);
        }

    }

}
